package com.lzz.rabbitmq;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zhenzhen
 * @date 2018-12-20 下午4:12
 */
@Component
public class HelloSender2 {
    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send(String data) {
        String context = "hello" + data;
        System.out.println("Sender2:"+context);
        this.rabbitTemplate.convertAndSend("hello", context);
    }
}
